﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NEWSPAPERINFOMATION
{
    public partial class mainw : Form
    {
        String jb;   //登录的用户的身份，user或admin
        String whoid;//登录的用户的id
        public mainw(String whojibie,String whoid)
        {
            InitializeComponent();
            jb = whojibie;
            this.whoid = whoid;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            From1 fromx= new From1(jb, whoid,1);    //有参构造，传入登录用户的类别以及id
            fromx.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            From1 fromx = new From1(jb, whoid, 3);    //有参构造，传入登录用户的类别以及id
            fromx.Show();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            From1 fromx = new From1(jb, whoid, 5);    //有参构造，传入登录用户的类别以及id
            fromx.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (jb.Equals("user"))
            {
                MessageBox.Show("您无权限！");
                return;
            }
            else
            {
                From1 fromx = new From1(jb, whoid, 2);    //有参构造，传入登录用户的类别以及id
                fromx.Show();
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            From1 fromx = new From1(jb, whoid, 4);    //有参构造，传入登录用户的类别以及id
            fromx.Show();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (jb.Equals("user"))
            {
                MessageBox.Show("您无权限！");
                return;
            }
            else
            {
                From1 fromx = new From1(jb, whoid, 7);    //有参构造，传入登录用户的类别以及id
                fromx.Show();
            }
        }

      
    }
}
